package com.example.wechathook.hook;

import static de.robv.android.xposed.XposedBridge.log;
import static de.robv.android.xposed.XposedHelpers.findAndHookConstructor;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.callbacks.XC_LoadPackage;

/**
 * 微信本地sqlite数据获取
 * 
 * @author chencq
 *
 */
public class DbHook extends BaseHook{

	@Override
	public void hook(XC_LoadPackage.LoadPackageParam lpp) {
		findAndHookConstructor("com.tencent.mm.storage.h", lpp.classLoader, "com.tencent.mm.bb.g", new XC_MethodHook() {
			@Override
			protected void afterHookedMethod(MethodHookParam param) throws Throwable {
				Object db = param.args[0];
				if (db != null)
					log("DB:" + db.toString());
			}
		});
	}

}
